<template>
<!-- <div class="example"> -->
  <!-- <a-spin :spinning="spining" /> -->
  <!-- <page-layout :title="title"> -->
    <a-card :bordered="false">
      <detail-list title="推广员基本信息">
        <detail-list-item term="推广员名称">{{ promoters.username }} </detail-list-item>
        <detail-list-item term="手机号">{{ promoters.mobile }}</detail-list-item>
        <detail-list-item term="性别">{{ promoters.sex = "0" ? "男" : "女" }}</detail-list-item>
        <detail-list-item term="昵称">{{ promoters.nickName }}</detail-list-item>
        <detail-list-item term="真实姓名">{{ promoters.realName }}</detail-list-item>
      </detail-list>
      <a-divider style="margin-bottom: 32px"/>
      <div class="title">推广员推广信息</div>
         <a-table
            :columns="promotionColumns"
            :dataSource="informationList"
              >
         </a-table>
    </a-card>
  <!-- </page-layout> -->
<!-- </div> -->
</template>

<script>
  import PageLayout from '@/components/page/PageLayout'
  import STable from '@/components/table/'
  import DetailList from '@/components/tools/DetailList'
  import ABadge from "ant-design-vue/es/badge/Badge"
   import { putAction } from '@/api/manage'
  import { postAction } from '@/api/manage'
  import { getAction } from '@/api/manage'
  const DetailListItem = DetailList.Item

  export default {
    components: {
      PageLayout,
      ABadge,
      DetailList,
      DetailListItem,
      STable
    },
    
    data () {
       
      return {
          flag:"flag",
         state: {
          time: 60,
          smsSendBtn: false,
        },
        spinning:false,
        promoters:{},
        informationList:[],
        promotionColumns: [
          {
            title: '店铺名称',
            dataIndex: 'shopName',
            key: 'shopName'
          },
          {
            title: '推广地址',
            dataIndex: 'address',
            key: 'address'
          },
          {
            title: '分成比例',
            dataIndex: 'proportion',
            key: 'proportion'
            // ,
            // align: 'right'
          },
          {
            title: '分成类型',
            dataIndex: 'type',
            key: 'type'
            // ,
            // align: 'right'
          }
        
        ]


      }
    },
    created(){
      this.ToExamine(this.$route.query.record.id);
    },
    mounted(){
    },
    activated(){
      this.ToExamine(this.$route.query.record.id);
    
    },
    methods: {
    //获取数据 spu+一道多个sku
    ToExamine(ids) {
          let toParams = {id:ids};
          this.$nextTick(function () {
            getAction("/promotion/web/getPromotionInformation",toParams)
                      .then(res => {
                        if(res.success){
                        this.promoters = res.result
                        this.informationList=this.promoters.promotionList
                        }else{
                          this.$notification[ 'error' ]({
                          message: "错误提示",
                          description:res.message,
                          duration: 4,
                        });
                        }
                      })
                      .catch(err => {
                      });
            })
        },
  //关闭标签
  closetab(){
       this.$router.back()
  },
    
    },
    
    filters: {
      statusFilter(status) {
        const statusMap = {
          'processing': '进行中',
          'success': '完成',
          'failed': '失败'
        }
        return statusMap[status]
      }
    },
    computed: {
      title () {
        return this.$route.meta.title
      }
    },
  }
</script>

<style lang="scss" scoped>
  .title {
    color: rgba(0,0,0,.85);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
  }
  .exampless {
    text-align: center;
    border-radius: 4px;
    margin-bottom: 30px;
    margin-top: 50px;
  }
</style>
<style lang="scss" scoped>
  .totop{
    height: 50px;
    width: 300px;
    color: red;
  }
  .toleft{

  }
  .tocenter{

  }
  .toright{

  }
</style>